<!-- analysis_result.html -->
<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>数据分析结果</title>
    <link rel="stylesheet" href="../static/css/dashboard.css" />
  </head>
  <body>
    <div class="container">
      <!-- 导航栏 -->
      <nav class="navbar">
        <a href="{{ url_for('center') }}">
          <button class="nav-button" id="center-btn">个人中心</button>
        </a>
        <a href="{{ url_for('account') }}">
          <button class="nav-button" id="account-btn">账号安全</button>
        </a>
          <a href="{{ url_for('guide') }}">
              <button class="nav-button" id="guide-btn">使用指南</button>
          </a>
        <a href="{{ url_for('crawler') }}">
          <button class="nav-button">评论数据获取</button>
        </a>
        <a href="{{ url_for('exploration') }}">
          <button class="nav-button">探索型数据分析</button>
        </a>
        <button class="nav-button" id="logout-btn">退出登录</button>
      </nav>

      <!-- 主内容区域 -->
      <main class="main-content">
        <h1>数据分析结果</h1>

        <p>筛选日期范围：{{ start_date }} 至 {{ end_date }}</p>

        <h3>数据分析结果</h3>
        <p>总值：{{ analysis_result['total'] }}</p>
        <p>平均值：{{ analysis_result['average'] }}</p>
        <h4>各类别汇总：</h4>
        <ul>
          <li>类别 A：{{ analysis_result['categories']['A'] }}</li>
          <li>类别 B：{{ analysis_result['categories']['B'] }}</li>
          <li>类别 C：{{ analysis_result['categories']['C'] }}</li>
        </ul>

        <h3>数据表格</h3>
        <table>
          <thead>
            <tr>
              <th>日期</th>
              <th>值</th>
              <th>类别</th>
            </tr>
          </thead>
          <tbody>
            {% for record in data %}
            <tr>
              <td>{{ record.date }}</td>
              <td>{{ record.value }}</td>
              <td>{{ record.category }}</td>
            </tr>
            {% endfor %}
          </tbody>
        </table>
      </main>
    </div>
  </body>
</html>
